package com.yk.test.entity;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table
@Data
@org.hibernate.annotations.Table(appliesTo = "client_details",comment="客户端表")
@EntityListeners(AuditingEntityListener.class)
public class ClientDetails implements Serializable {

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;

    @Column(nullable = false,columnDefinition = "varchar(255) comment '客户端标识'")
    private String clientId;

    @Column(nullable = false,columnDefinition = "varchar(255) comment '客户密码'")
    private String clientSecret;

    @Column(nullable = false,columnDefinition = "varchar(255) comment '作用范围'")
    private String scope;

    @Column(nullable = false,columnDefinition = "varchar(255) comment '认证方式'")
    private String grantTypes;

    @Column(nullable = false,columnDefinition = "int(1) comment '客户端状态，0启用，1禁用'")
    private int status;

    @CreatedDate
    private Date createTime;

    @LastModifiedDate
    private Date updateTime;
}
